Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unmount on destroy invalidating pending tasks #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

santiagodelossantos
Copy link

I'm working on a proyect where I need to destroy and recreate the svelte-virtual-list in order to reflect some changes. After doing that this error appears on the console:

Uncaught (in promise) TypeError: Cannot read property 'offsetHeight' of undefined
    at refresh

It happens that a pending refresh is failing after destroying the component, because it awaits for next ticks inside the function, and after those awaits in some moment the component is no longer available.

I prupose to mark mounted as false when the component is being destroyed so pending task can know it.

Sorry for my english 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant